package rottenbren.dev.android.diary.adapter;

import java.util.List;

import rottenbren.dev.android.diary.activity.R;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class CalendarAdapter extends ArrayAdapter<String> {

	public CalendarAdapter(Context context, int textViewResourceId, List<String> objects) {
		super(context, textViewResourceId, objects);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null)
		{
			LayoutInflater inflater = LayoutInflater.from(getContext());
			convertView = inflater.inflate(R.layout.day_gridtext, parent, false);
		}

		
		TextView tv = (TextView) convertView.findViewById(R.id.gridText);
		final String data = this.getItem(position);
		tv.setText(data);
		convertView.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				Log.d("디버그", ((TextView)v).getText().toString());
			}
		});

		return convertView;
	}
	
	

}
